home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln1084.arc
/
MAKEREM.LTG
< prev
next >
Wrap
Text File
|
1986-10-01
|
2KB
|
59 lines
echo off
if exist %1.bat goto er
md %1
copy \tosub.bat %1.bat >nul:
echo >>#dirlog.bat command/c #rms# %1 /
echo Created directory %1
goto ex
:er
echo Cannot create %1, file %1.bat already exists
:ex
MKS.BAT -- Make a subdirectory. This file requires that
TOSUB.BAT (below) be installed in the root directory.
echo off
cd %0
if exist autoexec.bat autoexec
TOSUB.BAT -- See MYSTERY.BAT in the text of this article.
echo off
confirm Will remove %1 and all subdirectories and files, OK?
if errorlevel 1 goto ex
command/c #rms# %1 >nul:
find/v "# %1 /" <#dirlog.bat >#dirlog.tmp
del #dirlog.bat
ren #dirlog.tmp #dirlog.bat
:ex
RMS.BAT -- Remove a subdirectory. This file requires that
a file called "Y" containing the single character "y" be
installed in the root directory. #RMS#.BAT and FIND.EXE
must also be accessible using the current search path.
if not exist %1.bat goto er
cd %1
if not exist #dirlog.bat goto rm
command/c #dirlog >nul:
:rm
echo >con: Removing directory %1
del *.* >nul: <\y
cd ..
del %1.bat
rd %1
exit
:er
echo >con: Cannot remove %1, file %1.bat does not exist
#RMS#.BAT -- A procedure to be called from RMS.BAT only!
Listing 3: Batch Files to Make and Remove Subdirectories